package com.example.weibo.controller;

import com.example.weibo.service.WeiboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/weibo")
public class WeiboController {

    @Autowired
    private WeiboService weiboService;

    @PostMapping("/publish")
    public ResponseEntity<String> publishWeibo(@RequestBody String content) {
        weiboService.publishWeibo(content);
        return ResponseEntity.ok("微博发布成功!");
    }
}